@use '../partials/mixin' as mx;

.CSS_START_components_allPublicationsPage {
    display: none;
}

.allBooks {
    &_header {
        font-size: 20px;
        max-width: 80%;
        text-overflow: ellipsis;
        overflow: hidden;
        text-wrap: nowrap;
        margin-bottom: 10px;


        &_navigation {
            background-color: var(--color-gray-50);
            border-radius: 6px;
            height: 75px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 5px 20px 0;
            margin: 10px 0;
            width: inherit;

            @media screen and (width <= 1072px) {
                height: 125px;
            }

            &_inputs {
                display: flex;
                align-items: end;
                gap: 10px;
                height: 56px;

                @media screen and (width <= 1072px) {
                    gap: 25px;
                    flex-direction: column;
                    align-items: start;
                    height: unset;
                }
            }

            .form_group {
                width: 260px!important;
                height: 30px!important;

                &:has(input:focus) {
                    outline: var(--color-brand-primary) solid 2px !important;
                    outline-offset: -2px;
                  }

                * {
                    margin-left: 0.4em;
                }

                label {
                    background-color: var(--color-gray-50);
                    // top: -18px;
                }

                i {
                    position: relative;
                    width: 25px;
                    height: 25px;
                    margin: auto;

                    svg {
                        width: 20px;
                        height: 20px;
                    }
                }

                #globalSearchInput {
                    width: 100%;
                    padding: 0.2em;
                    height: 30px;

                    &::placeholder {
                        color: #aaa8a8;
                    }
                }

                > div {
                    display: inline-block;
                    overflow: visible;
                    white-space: nowrap;
                }

                > button {
                    padding: 0.6em;
                }
            }
        }

        &_pagination {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 5px;

            &_title {
                font-size: 14px;
                font-weight: 600;
                // margin: 0 0 5px 40px;
                // position: absolute;
                // top: -18px;
                // left: 12px;
            }

            &_container {
                display: flex;
                align-items: center;

                button[disabled] {
                    color: gray;
                }

                svg {
                    width: 20px;
                    margin: 0 5px;
                }
            }

            &_arrow {
                margin: 0;
                padding: 0;
                width: 30px;
                color: var(--color-brand-primary);
                height: 32px;

                a {
                    color: var(--color-brand-primary);
                }
            }

            &_select {
                cursor: pointer;
                min-width: 7em;
                text-align: center;
                padding: 0.2em;
                margin: 0;
                margin-left: 0;
                margin-right: 0;
                border: 1px solid gray;
                border-radius: 4px;
                height: 30px;
                background-color: var(--color-neutral-base);
                color: var(--color-text-primary);
            }

            &_opds_currentPage {
                min-width: 7em;
                display: flex;
                align-items: center;
                justify-content: center;
                border: 1px solid gray;
                border-radius: 4px;
                height: 30px;
            }
        }
    }
}

.opds_publication_wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;

    .allBooks_header_pagination_arrow:nth-child(2), .allBooks_header_pagination_arrow {
        padding-top: 0;

        &:not(:disabled) {
            &:nth-child(1), &:nth-child(5) {
            padding-top: 4px;
            }

            &:nth-child(2), &:nth-child(4) {
                padding-top: 2px;
            }
        }
    }
}

.showColFilters {
    &_wrapper {
        display: flex;
        align-items: center;

        .showColFilters_input {
            border: 1px solid var(--color-brand-primary);
            border-radius: 4px;
            margin: 0;
            padding: 0.2em;
            background-color: var(--color-neutral-base);        }
    }

    > button {
        border: 1px solid gray;
        border-radius: 4px;
        margin: 0;
        margin-left: 0.4em;
        width: 24px;
        height: 24px;
        padding: 0.2em;
     }
}

.cell {
    a {
        cursor: pointer;
    }

    &_coverImg {
        padding: 0;
        margin: 0;
        text-align: center;
        min-height: 100px;
        // border: 1px solid #e2e2e2;
        display: flex;
        cursor: pointer;

        img {
            object-fit: contain;
            width: 100%;
            height: 100%;
            min-height: 100px;
            cursor: pointer;
        }
    }

    &_bookTitle {
        font-weight: bold;
        padding: 0.4em 0;
        cursor: pointer;
    }

    &_link {
        display: flex;
        align-items: center;
        text-align: left;
        padding: 2px 6px;
        cursor: pointer;
        text-decoration: underline;
        text-decoration-skip: ink;
        margin-right: 6px;
        margin-bottom: 6px;
    }

    &_wrapper {
        display: flex;
        flex-flow: row wrap;
        align-items: center;
        justify-content: start;
        padding-top: 0.2em;
        overflow: hidden auto;
        height: 100px;
        margin-right: 2px;

        &:has(.button_nav_primary), &:has(.dropdown_trigger) {
            justify-content: center;
        }

        &:hover {
            &::-webkit-scrollbar-thumb {
                background-color: var(--color-brand-primary);
            }
        }

        @include mx.scrollbar_styling
    }

    &_multi_langs {
        list-style-type: none;
        padding: 5px;
        display: flex;
        flex-flow: column nowrap;
        align-items: start;
        justify-content: start!important;
        gap: 5px;
        max-height: 90px;

        li {
            margin: 0;
            padding: 0;
        }
    }

    &_description {
        position: relative;

        p {
            margin-top: 0;
            max-height: 65px;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        button {
            position: absolute;
            right: 0;
            bottom: -20px;
            color: var(--color-brand-primary);
            width: 15px;
            height: 15px;
        }
    }
}

.setShowColumnFiltersCheckboxLabel[data-focussed] {
    outline: var(--color-brand-primary) solid 2px !important;
    outline-offset: 4px;
}

/*
.setShowColumnFiltersCheckboxLabel:not([data-focussed]) {
}
*/

.allBook_table {
    border-radius: 8px;
    padding: 4px;
    margin: 0;
    border-spacing: 0;
    width: 100%;
    position: relative;

    &_wrapper {
        overflow: auto;
        inset: 240px 20px 75px 26px;
        padding: 0;
        margin-top: 0;
        margin-bottom: 0.4em;
        position: absolute;
        background-color: var(--color-neutral-base);

        @media screen and (width <= 1072px) {
            inset: 280px 20px 75px 26px;
        }

        @include mx.scrollbar_styling;

        &::-webkit-scrollbar {
            width: 10px;
            height: 10px;
            background-color: var(--color-neutral-base);

            &:hover {
                border-left: 0;
            }
        }

        &::-webkit-scrollbar-corner {
            background-color: transparent;
        }
    }

    &_head {
        border-bottom: 2px solid var(--color-brand-secondary);
        padding: 0.7em;
        margin: 0;
        background-color: var(--color-brand-secondary);
        white-space: nowrap;

        button, h4 {
            color: var(--color-brand-primary);
            height: auto;
            padding: 0.2em;
            margin: 0;
            font-weight: bold;
            margin-bottom: 4px;
        }
    }

    &_body {
        grid-template-columns: repeat(auto-fill, 210px);
        // grid-gap: 15px;
        row-gap: 30px;
        margin-bottom: 20px;
        background-color: var(--color-neutral-base);

        tr td {
            border-bottom: none;
            margin: 0;
            padding: 0;
        }
    }
}

.filter_container {
    .react_aria_ComboBox {
        position: relative;
        padding: 0;
        margin: 0;

        .react_aria_Label {
            position: absolute;
            top: -20px;
        }

        .react_aria_Input {
            width: inherit;
        }

        .my_combobox_container {
            // min-width: 150px;
            background-color: var(--color-neutral-base);
            padding: 2px 0;
            width: 264px;
            height: 30px;

            button span {
                width: fit-content;
                min-width: 100px;
                padding: 0 10px;
                text-align: left;
            }

            .react_aria_Button {
                margin-left: unset;
                margin-right: 5px;
                height: 24px;
                width: 24px;
                display: flex;
                align-items: center;
                justify-content: center;
            }
        }
    }
}

.CSS_END_components_allPublicationsPage {
    display: none;
}
